package service.impl;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import dao.UserDao;
import po.User;
import service.UserService;
/**
 * 用户Service接口实现�?
 */
@Service("userService")
@Transactional
public class UserServiceImpl implements UserService {
	// 注入UserDao
	@Autowired
	private UserDao userDao;
	// 通过账号和密码查询用户
	@Override
	public User findUser(String usercode, String password) {
		User user = this.userDao.findUser(usercode, password);
		return user;
	}
//	@Override
//	public List getUserlist() {
//		List list=userDao.getUserlist();
//		return list;
//	}
	@Override
	public List<User> getUserList() {
		
		return userDao.getList();
	}
	@Override
	public int deleteUser(Integer userid) {
		
		return userDao.delUser(userid);
	}
	@Override
	public int addUser(User user) {
		
		return userDao.addUser(user);
	}
	@Override
	public User getUserId(Integer user_id) {
		return userDao.getUserId(user_id);
	}
	@Override
	public int updateUser(User user) {
		return userDao.updateUser(user);
	}
	@Override
	public List<User> findList(String data) {
		return userDao.findList(data);
	}


}
